import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import { terser } from "rollup-plugin-terser";

export default {
  input: "src/FormStorage.ts",
  output: [
    {
      file: "dist/FormStorage.cjs.js",
      format: "cjs",
      sourcemap: true,
    },
    {
      file: "dist/FormStorage.js",
      format: "esm",
      sourcemap: true,
    },
    {
      file: "dist/FormStorage.umd.js",
      format: "umd",
      name: "FormStorage",
      sourcemap: true,
    },
  ],
  plugins: [
    typescript({ tsconfig: "./tsconfig.json" }),
    resolve(),
    commonjs(),
    terser(),
  ],
};
